﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Nantianmen.Shared
{
    public class Paging
    {
        public int Index { get; set; }
        public int Size { get; set; }

        public Paging(int index, int size)
        {
            Index = index;
            Size = size;
        }
    }

    public class PagingList<T> : Paging
    {
        public List<T> Datas { get; set; }
        public long TotalCount { get; set; }

        public PagingList(List<T> datas, long totalCount, Paging paging) : base(paging.Index, paging.Size)
        {
            Datas = datas;
            TotalCount = totalCount;
        }

        public PagingList(Paging paging) : this([], 0, paging)
        {

        }
    }

}
